package cn.tedu.boot011.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@Controller
public class HelloController {
//    @RequestMapping("/hello")
//    public void hello(HttpServletRequest request, HttpServletResponse response) throws IOException {
//        response.setContentType("text/html;charset=utf8");
//        PrintWriter pw=response.getWriter();
//        pw.println("服务器接收到了响应");
//        pw.close();
//
//    }
@RequestMapping("/hello")
@ResponseBody
public String hello(HttpServletRequest request, HttpServletResponse response) throws IOException {
    return "服务器接受到了响应sad";
}
}
